package com.xyoto.community.adminController;

import com.xyoto.community.dto.UserSaveTitleDTO;
import com.xyoto.community.service.UserTitleService;
import com.xyoto.community.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;

//@Api(tags = "用户头衔(后台)")
@RestController
@RequestMapping("/admin/userTitle")
public class UserTitleAdminController {

    @Autowired
    private UserTitleService userTitleService;

    //    @ApiOperation("新增头衔")
//    @PostMapping("/saveTitle")
    @Deprecated
    public Result saveTitle(MultipartFile multipartFile) {
        return userTitleService.saveTitle(multipartFile);
    }

    //    @ApiOperation("删除头衔")
//    @DeleteMapping("/removeTitleById")
    @Deprecated
    public Result removeTitleById(@RequestParam("id") Integer id) {
        return userTitleService.removeTitleById(id);
    }

    //    @ApiOperation("用户新增头衔")
//    @PostMapping("/userSaveTitle")
    @Deprecated
    public Result userSaveTitle(@RequestBody @Valid UserSaveTitleDTO userSaveTitleDTO) {
        return userTitleService.userSaveTitle(userSaveTitleDTO);
    }

}
